package com.ys.mapper.bi;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.ys.entity.bi.AccountCountForCompanyHistoryBi;
import com.ys.entity.bi.BiBusinessFundsRemark;
import com.ys.entity.bi.BiFinancialFunds;
import com.ys.entity.finance.TcwProformaInvoiceItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BiMapper {

	/**
	 * 店铺销售
	 */
	public Map<String, Object> getDPXX(@Param("timeType")Integer timeType,@Param("dayBegin")String dayBegin,@Param("dayEnd")String dayEnd, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 店铺广告
	 */
	public Map<String, Object> getDPGG(@Param("timeType")Integer timeType,@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 商品TOP10
	 */
	public List<Map<String, Object>> topProduct(@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd, @Param("vSfJp")String vSfJp, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 店铺TOP10
	 */
	public List<Map<String, Object>> topShop(@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt,
			@Param("today")String today);

	/**
	 * 精品广告TOP10
	 */
	public List<Map<String, Object>> topProductAdvert(@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 业绩趋势-近七天销售业绩
	 */
	public List<Map<String, Object>> yjqsXsyjt(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt,
			@Param("dayBegin")String dayBegin,
			@Param("dayEnd")String dayEnd);

	/**
	 * 业绩趋势-近七天广告业绩
	 */
	public List<Map<String, Object>> yjqsGgyjt(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt,
			@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd);

	/**
	 * 业绩趋势-近七天广告效果
	 */
	public List<Map<String, Object>> yjqsGgxgt(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt,
			@Param("dayBegin")String dayBegin, @Param("dayEnd")String dayEnd);

	/**
	 * 近30天销量
	 */
	public BigDecimal sumLatest30(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 库存数量-仓库
	 */
	public BigDecimal sumStock(@Param("gdepot")String gdepot, @Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 库存数量-网店商品信息-在途
	 */
	public BigDecimal sumAmazonShopProductZT(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 库存数量-网店商品信息-在售
	 */
	public BigDecimal sumAmazonShopProductZS(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 广告指标对比-近七天
	 */
	public Map<String, Object> ggzbdbLatest(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 广告指标对比-上七天
	 */
	public Map<String, Object> ggzbdbBefore(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 广告沙漏-近七天
	 */
	public Map<String, Object> ggslLatest7(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);

	/**
	 * 广告沙漏-近七天
	 */
	public Map<String, Object> ggslBefore7(@Param("listShop")List<Long> listShop, @Param("authType")Integer authType, @Param("userId")String userId,
			@Param("operateOrgNodeLft")Long operateOrgNodeLft,
			@Param("operateOrgNodeRgt")Long operateOrgNodeRgt);


	/**
	 * 分类模块业务流水分析汇总统计
	 */
	public List<Map<String, Object>> countBiClassifyModule(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("dataType")int dataType);

	/**
	 * 根据统计日期，删除分类模块业务流水分析汇总统计
	 */
	public int delBiClassifyModuleByStatDate(@Param("statDate")String statDate);


	/**
	 * 根据统计日期类型（0按日、1按月），删除分类模块业务流水分析汇总统计
	 */
	public int delBiClassifyModuleByStatDateType(@Param("statDateType")Integer statDateType);


	/**
	 * 获取万里汇数据资金数据
	 */
	List<BiFinancialFunds> getCwBiFinancialFundsList();

	/**
	 * 批量新增财务资金bi数据
	 * @param biFinancialFundsList
	 * @return
	 */
	int insetBatchBiFinancialFunds(List<BiFinancialFunds> biFinancialFundsList);

	/**
	 * 获取对公户银行账户实时资金数据资金数据
	 */
	List<BiFinancialFunds> getCwTcwFinancialTransactionFlow();


	/**
	 * 获取业务流水分析汇总统计数据-汇总数据
	 */
	public List<Map<String, Object>> getBiClassifyModuleCountByTotal(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("classifyType")int classifyType);

	/**
	 * 获取业务流水分析汇总统计数据-根据月份汇总数据
	 */
	public List<Map<String, Object>> getBiClassifyModuleCountGroupByMonth(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("classifyType")int classifyType);


	/**
	 * 获取预支账户
	 */
	List<BiFinancialFunds> getCwAdvanceAccount();

	/**
	 * 获取近12个月的数据
	 */
	List<BiFinancialFunds> getBiFinancialTrend(List<String> list);

	/**
	 * 历史资金近7天数据
	 */
	List<AccountCountForCompanyHistoryBi> getAccountCountForCompanyHistorySeven();

	/**
	 * 根据统计日期类型（0按日、1按月），删除流水分析统计汇总表
	 */
	public int delBiFlowAnalysisByStatDateType(@Param("statDateType")Integer statDateType);

	/**
	 * 根据统计日期，删除流水分析统计汇总表
	 */
	public int delBiFlowAnalysisByStatDate(@Param("statDate")String statDate);


	/**
	 * 分类模块业务流水分析汇总统计
	 */
	public List<Map<String, Object>> countBiFlowAnalysis(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("dataType")int dataType);


	/**
	 * 获取流水分析汇总统计数据-汇总数据
	 */
	public List<Map<String, Object>> getBiFlowAnalysisCountByTotal(@Param("startTime")String startTime, @Param("endTime")String endTime,@Param("statDateType")int statDateType);


	/**
	 * 获取流水分析汇总统计数据-根据财务交易bid
	 */
	public List<Map<String, Object>> getBiFlowAnalysisCountGroupByFinancialTransactionType(@Param("startTime")String startTime, @Param("endTime")String endTime);


	/**
	 * 新增昨天的流水前三交易类型
	 */
	void insertBiBusinessFundsRemarkList();
}